//
//  CategorySearchCell.m
//  Tang
//
//  Created by 352324497@qq.com on 15/12/7.
//  Copyright © 2015年 352324497@qq.com. All rights reserved.
//

#import "CategorySearchCell.h"

@implementation CategorySearchCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
//        CGFloat width = frame.size.width / 4;
        CGFloat width = (KWidth - 30 * Kx6) / 4 - 20 * Kx6;
        self.icon = [[UIImageView alloc]initWithFrame:CGRectMake(10 * Kx6, 10 * Kx6, width, width)];
        [self.contentView addSubview:_icon];
        
        self.name = [[UILabel alloc]initWithFrame:CGRectMake(width + 30 * Kx6, 10 * Kx6, width, width)];
        self.name.textColor = [UIColor darkGrayColor];
        self.name.font = [UIFont systemFontOfSize:18 * Kx6];
        [self.contentView addSubview:_name];
    }
    return self;
}

-(void)setModel:(CategoryModel *)model
{
    _model = model;
    [self.icon sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:[UIImage imageNamed:@"PC"]];
    self.name.text = model.name;
    
}


@end
